<template>
    <!-- 每一个店铺数据 -->
    <div class="item" @click="toStore">
        <img :src="item.pic" alt="">
        <div class="item_right">
            <div class="title">{{ item.title }}</div>
            <div class="sales">月售:{{ item.sales }}</div>
            <div class="price">起送费:{{ item.price }} 免配送费</div>
            <div class="label">
                <div v-for="(item,index) in item.label" :key="index">{{ item }}</div>
            </div>
        </div>
    </div>
</template>

<script setup>

import { useRouter } from 'vue-router';
let props = defineProps(['storeList']);
// 顶一个变量接收数据
let item = props.storeList;

// 路由跳转  引入useRouter() 方法
const router = useRouter();
// 跳转页面
const toStore = () => {
    router.push('/store')
}
</script>

<style scoped lang="less">
.item{
    display: flex;
    padding:10px;
    justify-content: space-between;
    img{
        width:120px;
        height:120px;
        border-radius: 10px;
    }
    .item_right{
        display: flex;
        flex-wrap: wrap;
        flex-direction: column;
        width:calc(100% - 150px)
    }
    .title{
        font-size: 18px;
    }
    .sales,.price,.label{
        font-size: 14px;
    }
    .sales,.price{
        margin-top:10px;
    }
    .label{
        display: flex;
        margin-top:10px;
        div{
            background-color: #ffc400;
            padding:2px 5px;
            border-radius: 5px;
            margin-right: 5px;
        }
    }
}
</style>
